package com.raymond.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.raymond.sys.entity.Busmanager;
import com.raymond.sys.entity.SysUser;
import com.raymond.sys.mapper.BusManagerMapper;
import com.raymond.sys.mapper.SysUserMapper;
import com.raymond.sys.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 操作员表 服务实现类
 * </p>
 *
 * @author raymond
 * @since 2019-11-22
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
    private final BusManagerMapper busManagerMapper;
    private final SysUserMapper sysUserMapper;

    public SysUserServiceImpl(BusManagerMapper busManagerMapper, SysUserMapper sysUserMapper) {
        this.busManagerMapper = busManagerMapper;
        this.sysUserMapper = sysUserMapper;
    }

    @Override
    public SysUser getUser() {
        IPage<SysUser> userPage = new Page<>(1, 1);
        IPage<Busmanager> busmanagerPage = new Page<>(1, 1);
        IPage<SysUser> userPages = sysUserMapper.selectPage(userPage, null);
        IPage<Busmanager> busmanagerIPage = busManagerMapper.selectPage(busmanagerPage, null);
        return userPages.getRecords().get(0);
    }
}
